<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表白墙</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .container {
            width: 500px;
            height: 500px;
            background-color: rgba(233, 127, 180, 0.374);
            margin: 0 auto;
        }

        h1 {
            text-align: center;
            padding: 10px 0;
        }

        p {
            font-size: 14px;
            color: rgba(128, 128, 128, 0.407);
            text-align: center;
            padding: 10px 0;
        }

        .row {
            height: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        span {
            width: 60px;
            font-size: 20px;
        }

        input {
            width: 200px;
            height: 40px;
        }

        #submit {
            width: 200px;
            color: white;
            background-color: orange;
            border: none;
            border-radius: 5px;
            font-size: 18px;
        }

        #submit:active {
            background-color: rgba(252, 214, 27, 0.877);
        }
    </style>
</head>

<body>
    <form action="message" method="POST">
        <div class="container">
            <h1>表白墙</h1>
            <p>输入后点击提交，会将信息显示至表白墙</p>
            <div class="row">
                <span>谁:</span>
                <input type="text" class="edits" name="from">
            </div>
            <div class="row">
                <span>对谁:</span>
                <input type="text" class="edits" name="to">
            </div>
            <div class="row">
                <span>想说:</span>
                <input type="text" class="edits" name="words">
            </div>
            <div class="row">
                <input type="submit" id="submit" value="提 交">
            </div>
        </div>

        <div class="row" th:each="message:${messages}">
            <span th:text="${message.from}"></span>
            对
            <span th:text="${message.to}"></span>
            说:
            <span th:text="${message.words}"></span>
        </div>
    </form>
</body>

</html>